<?php
	session_start();	
?>

<?php
	if( $_SESSION["admin"] != "" )
	{
?>
<a href="index.php?com=review"><b>List review</b></a> 
<br />
<?php
	include_once("process/review.php");	
	$review = new review();	
    $pager = new PS_Pagination($review->_connection, $review->GetListPaging(), 15, 5, "", "?com=review");
	
	$rs = $pager->paginate();

	$table = '<table width="100%" style="font-size:10pt;">
				<tr>
					<td align="center" colspan="9" height="50"><b style="font-size:12pt; color:Blue;">List Review</b></td>
				</tr>
				<tr bgcolor="#996699" style=" font-weight:bold;">						
					<td style="padding:4px;">Customer</td>
                    <td style="padding:4px;">Product</td>
                    <td style="padding:4px;">Date write</td>
                    <td style="padding:4px;">Subject</td>
                    <td style="padding:4px;">Full name</td>
                    <td style="padding:4px;">City</td>
                    <td style="padding:4px;">State</td>
                    <td style="padding:4px;">ActiveYN</td>
					<td style="padding:4px;" align="center" width="70px" colspan="2"></td>
				</tr>';
       while($list = mysql_fetch_assoc($rs))
	{
	   if($list['activeYN'] == 1)
        {
            $list['activeYN'] = "<a href='"."index.php?com=review&func=update&id=".$list['review_id']."'>In active</a>";
         }
         else
         {
            $list['activeYN'] = "<a href='"."index.php?com=review&func=update&id=".$list['review_id']."'>Un active</a>";
         }
		$table .= '	<tr bgcolor="#FFFFFF"  onMouseOver="this.bgColor = '."'#C0C0C0'".'" onMouseOut ="this.bgColor = '."'#FFFFFF'".'">
						
						<td style="padding:4px;">
							'.$list['Email'].'
						</td>
                        	
						<td style="padding:4px;">
							'.$list['Product'].'
						</td>
                        	<td style="padding:4px;">
							'.$list['datewrite'].'
						</td>
                        <td style="padding:4px;">
							'.$list['subject'].'
						</td>
                        	
						<td style="padding:4px;">
							'.$list['fullname'].'
						</td>
                        	<td style="padding:4px;">
							'.$list['city'].'
						</td>
                        <td style="padding:4px;">
							'.$list['state'].'
						</td>
						<td style="padding:4px;">
							'.$list['activeYN'].'
						</td>
						<td align="center">
							<a onClick="'."return confirm('Do you want to delete this category ?')".'"  style="color:#0033FF" href="index.php?com=review&func=delete&id='.$list['review_id'].'">
								Delete
							</a>
						</td>
					</tr>';
           }
	//endforeach;
	$table .= '</table>';
	echo $table.'<br />';
	echo $pager->renderFullNav();
    }
   else
	{
		echo "<meta http-equiv='refresh' content='0; url=login.php' />";
	}
?>